﻿//////////////////////////////////////////////////////////////////////////////
//                                                                          //
// Copyright 2010 ZGDev Software                                            //
//                                                                          //
// Licensed under the Apache License, Version 2.0 (the "License");          //
// you may not use this file except in compliance with the License.         //
// You may obtain a copy of the License at                                  //
//                                                                          //
//   http://www.apache.org/licenses/LICENSE-2.0                             //
//                                                                          //
// Unless required by applicable law or agreed to in writing, software      //
// distributed under the License is distributed on an "AS IS" BASIS,        //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and      //
// limitations under the License.                                           //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////

using System;
using System.Drawing;

/// <summary>
/// This namespace contains defintions of FormSpark's default animation curve implementations.
/// </summary>
namespace ZGDev.FormSpark.AnimationCurves
{
    /// <summary>
    /// A utility class for creating commonly used animation curves. It is important to remember
    /// that these methods don't return a shared instance but rather create instances on demand.
    /// </summary>
    /// <seealso cref="LinearCurve"/>
    /// <seealso cref="BezierCurve"/>
    /// <seealso cref="IAnimationCurve"/>
    public static class AnimationCurve
    {
        /// <summary>
        /// Linear animation curve.
        /// </summary>
        /// <seealso cref="IAnimationCurve"/>
        /// <seealso cref="LinearCurve"/>
        public static IAnimationCurve Linear
        {
            get
            {
                return new LinearCurve();
            }
        }

        /// <summary>
        /// Default animation curve (Bezier similar to |EaseIn| but doesn't start off as slow)
        /// </summary>
        /// <seealso cref="IAnimationCurve"/>
        /// <seealso cref="BezierCurve"/>
        public static IAnimationCurve Default
        {
            get
            {
                return new BezierCurve();
            }
        }

        /// <summary>
        /// Animation curve that causes animations to "ease in." Animations start of slow then
        /// get faster.
        /// </summary>
        /// <seealso cref="IAnimationCurve"/>
        /// <seealso cref="BezierCurve"/>
        public static IAnimationCurve EaseIn
        {
            get
            {
                return new BezierCurve(new PointF(0.5f, 0.0f), new PointF(0.5f, 0.0f));
            }
        }

        /// <summary>
        /// Animation curve that causes animations to "ease out." Animations start off
        /// comparatively fast then slow down as they finish.
        /// </summary>
        /// <seealso cref="IAnimationCurve"/>
        /// <seealso cref="BezierCurve"/>
        public static IAnimationCurve EaseOut
        {
            get
            {
                return new BezierCurve(new PointF(0.2f, 0.8f), new PointF(0.2f, 0.8f));
            }
        }

        /// <summary>
        /// Animation curve that is a combination of |EaseIn| and |EaseOut|. Animations start of slow,
        /// get faster in the middle, then slow down again as they finish.
        /// </summary>
        /// <seealso cref="IAnimationCurve"/>
        /// <seealso cref="BezierCurve"/>
        public static IAnimationCurve EaseInEaseOut
        {
            get
            {
                return new BezierCurve(new PointF(0.5f, 0.0f), new PointF(0.5f, 1.0f));
            }
        }
    }
}
